﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
/// <summary>
/// Summary description for KhachHangPublic
/// </summary>
namespace SachOnlineLibrary.Public
{
    public class TaiKhoan
    {
        public TaiKhoan()
        {
            //
            // TODO: Add constructor logic here
            //
        }
        private int _TKID;

        public int TKID
        {
            get { return _TKID; }
            set { _TKID = value; }
        }
        private string _TenTK;

        public string TenTK
        {
            get { return _TenTK; }
            set { _TenTK = value; }
        }
        private string _MatKhau;

        public string MatKhau
        {
            get { return _MatKhau; }
            set { _MatKhau = value; }
        }
        

        private string _Ten;

        public string Ten
        {
            get { return _Ten; }
            set { _Ten = value; }
        }
        private DateTime _NgaySinh;

        public DateTime NgaySinh
        {
            get { return _NgaySinh; }
            set { _NgaySinh = value; }
        }
        private string _Email;

        public string Email
        {
            get { return _Email; }
            set { _Email = value; }
        }
        private string _SoDT;

        public string SoDT
        {
            get { return _SoDT; }
            set { _SoDT = value; }
        }
        private string _DiaChi;

        public string DiaChi
        {
            get { return _DiaChi; }
            set { _DiaChi = value; }
        }
        private bool _Quyen;

        public bool Quyen
        {
            get { return _Quyen; }
            set { _Quyen = value; }
        }

        private bool _trangthai;

        public bool Trangthai
        {
            get { return _trangthai; }
            set { _trangthai = value; }
        }

        
        public void ChuyenDoi(DataRow dr)
        {
            TKID = int.Parse(dr[0].ToString());
            TenTK = dr[1].ToString();
            MatKhau = dr[2].ToString();
            Quyen = bool.Parse(dr[3].ToString());
            Ten = dr[4].ToString();
            NgaySinh = DateTime.Parse(dr[5].ToString());
            Email = dr[6].ToString();
            SoDT = dr[7].ToString();
            DiaChi = dr[8].ToString();
            Trangthai = bool.Parse(dr[9].ToString());
        }
    }
}